package 策略加工厂;

//维护算法
public class Context {
    private Strategy strategy;
    public Context(String strategy_str){
        switch (strategy_str){
            case "A":
                strategy = new ConcreteStrategyA();
                break;
            case "B":
                strategy = new ConcreteStrategyB();
                break;
            case "C":
                strategy = new ConcreteStrategyC();
                break;
        }
        this.strategy = strategy;
    }
    public void ContextInterface(){
        strategy.AlgorithmInterface();
    }
}
